package com.jy.modules.cims.component.balance.servicefee.impl;

import java.math.BigDecimal;

import com.jy.modules.cims.component.balance.servicefee.BaseServiceFee;
import com.jy.modules.cims.data.common.dto.TCMmCostParamDTO;
import com.jy.modules.cims.data.dto.CreditDetailDto;

/**
 * 
 * ClassName: ED e贷服务费，保证金，担保费计算
 * @Description: TODO
 * @author dell
 * @date 2016-4-7
 */
public class ED extends BaseServiceFee{

	//服务费
	public BigDecimal doServiceFee(CreditDetailDto creditDetailDto,
			TCMmCostParamDTO tcmmCostParamDto) {
		//获取服务费基数
		BigDecimal baseAmount = super.getBaseServiceFee(creditDetailDto, tcmmCostParamDto.getServiceFeeBase());
		//获取服务费率
		BigDecimal feeRate = tcmmCostParamDto.getServiceFeeRatio();
		return baseAmount.multiply(feeRate);
	}

	//担保费
	public BigDecimal doGuaranteeFee(CreditDetailDto creditDetailDto,
			TCMmCostParamDTO tcmmCostParamDto) {
		//获取担保费基数
		BigDecimal baseAmount = super.getBaseBondFee(creditDetailDto, tcmmCostParamDto.getGuaranteeFeeBase());
		//获取担保费率
		BigDecimal bondRate = tcmmCostParamDto.getGuaranteeFeeRatio();
		return baseAmount.multiply(bondRate);
	}

	//风险金
	public BigDecimal doRiskFee(CreditDetailDto creditDetailDto,
			TCMmCostParamDTO tcmmCostParamDto) {
		//风险金基数
		BigDecimal baseAmount = super.getBaseRiskFee(creditDetailDto, tcmmCostParamDto.getMarginBase());
		//风险金比例
		BigDecimal RiskRate = tcmmCostParamDto.getMarginRatio();
		return baseAmount.multiply(RiskRate);
	}


}
